package com.penglecode.netty3.example3;

import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.penglecode.netty3.example2.ServerMessageHandler;

public class ClientApplicationCommandHandler extends SimpleChannelHandler {

	private static final Logger logger = LoggerFactory.getLogger(ServerMessageHandler.class);
	
	public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
			throws Exception {
		ApplicationCommand command = (ApplicationCommand) e.getMessage();
		logger.debug("[client] received message from server = {}", command);
	}

	public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)
			throws Exception {
		logger.info("[client] a client channel connected to server!");
	}

}
